package com.jxust.dataformat.entity;

import java.util.Date;

import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;

public class User {
	@Range(min=100,max=11,message="内容必须在11到100之间")
	private Integer id;
	@NotEmpty
	private String name;
	@Email
	private String email;
	
	@NumberFormat(pattern="#,###,###,#")
	private Float idCard;
	@Past
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private Date birth;
	//birth 和idCard 的格式指明，输入的格式就必须匹配
	
	public User() {
		super();
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	public Float getIdCard() {
		return idCard;
	}
	public void setIdCard(Float idCard) {
		this.idCard = idCard;
	}

	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", email=" + email + ", idCard=" + idCard + ", birth=" + birth
				+ "]";
	}	
}
